package com.sat.wisdom.Views.Bases;

import android.app.Activity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.TextView;

import com.sat.slidemenu.SlideMenu;
import com.sat.wisdom.R;

/**
 * Project:Wisdom
 * Package:com.sat.wisdom.Views
 * Created by 透野君爱打奶炮 on 2018-04-25 at 18:52
 *
 * 5个标签页的基类
 */
public class BasePage {

    public Activity mActivity;
    public TextView tv_page_title;
    public ImageButton ivbt_menu;
    public FrameLayout fl_page_content;
    /** 当前页面的布局对象*/
    public View mRootView;

    public BasePage(Activity activity) {
        mActivity = activity;
        mRootView = initView();
    }

    public View initView() {
        View view = View.inflate(mActivity, R.layout.base_page, null);
        tv_page_title = view.findViewById(R.id.tv_page_title);
        ivbt_menu = view.findViewById(R.id.ivbt_menu);
        fl_page_content = view.findViewById(R.id.fl_page_content);
        ivbt_menu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SlideMenu slide_menu = mActivity.findViewById(R.id.slide_menu);
                slide_menu.switchState();
            }
        });
        return view;
    }

    public void initData() {

    }
}
